#include <iostream>
#include "ThreadPool.hpp"
int main()
{
    ThreadPool<int> *tp = new ThreadPool<int>(5);
    tp->start(); // 让线程池跑起来
    while (true)
    {
        // 1. 构建任务
        int x = rand() % 10 + 1;
        usleep(10);
        int y = rand() % 5;
        char op = opers[rand() % opers.size()];

        Task t(x, y, op);
        tp->push(t);
        // 2. 交给线程池处理
        std::cout << "main thread make task: " << t.GetTask() << std::endl;

        sleep(1);
    }
    return 0;
}